package com.wei800.turnover.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wei800.common.util.bean.DeepBeanUtils;
import com.wei800.dto.KuaiDiBoxOrderDTO;
import com.wei800.service.IKuaiDiBoxOrderService;
import com.wei800.turnover.entity.KuaiDiBoxOrder;
import com.wei800.turnover.mapper.IKuaiDiBoxOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class KuaiDiBoxOrderServiceImpl
        extends ServiceImpl<IKuaiDiBoxOrderMapper, KuaiDiBoxOrder>
        implements IKuaiDiBoxOrderService<KuaiDiBoxOrder> {
    @Autowired
    private IKuaiDiBoxOrderMapper kuaiDiBoxOrderMapper;
    @Override
    public boolean add(KuaiDiBoxOrderDTO dto) {
        KuaiDiBoxOrder entity = new KuaiDiBoxOrder();
        DeepBeanUtils.copyProperties(dto, entity);
        entity.setCreatetime(new Date());
        return this.kuaiDiBoxOrderMapper.insert(entity) > 0;
    }
}
